home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3777 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: damage.usa1.net!news
  2. From: crb3@usa1.com (crb3@usa1.com)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Printing to LPT1 Printer from within program
  5. Date: Wed, 31 Jan 1996 03:52:35 GMT
  6. Organization: USAinternet, Inc.
  7. Message-ID: <4emorv$782@damage.usa1.net>
  8. References: <4e5ee9$m28_001@pr.mcs.net>
  9. NNTP-Posting-Host: wmn1-222.usa1.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. Quoth mdp@mika-sys.com (Michael D. Perry):
  13.  
  14. >I have just started taking a C programming class and am using Borland 
  15. >C++ v4.0 at home.  Both my teacher and I are stumped as to how to 
  16. >print to a LPT (Line Printer) device from within the program.
  17.  
  18. (Noticing Pleimling's and Hutto's responses) ...and, as long as the
  19. obligatory declaration has been made that this is OS-specific stuff,
  20. and the more portable methods have been described, I'll drop this on
  21. the table:
  22.  
  23. [from Turbo C 2.0 manual... the function name also appears in BC3.1
  24. libs -- sorry, my BC3.1 books on wrong side of continent for a quick
  25. paper check -- so presumably the function's the same throughout the
  26. product line]
  27.  
  28. int biosprint(int cmd, int abyte,int port);
  29. printer I/O using BIOS services directly
  30. prototype: bios.h
  31. port:
  32. 0= lpt1 .. 2= lpt3
  33. abyte: 0..255
  34. cmd:
  35. 0 - print abyte
  36. 1 - init printer port
  37. 2 - read printer status
  38.   that's the most direct way to write to a *specific* printer in a
  39. Borland C program. Put the portable method in the program too, though;
  40. else how can you allow the user to print-to-disk?
  41. --cr
  42.  
  43.  
  44.